﻿namespace Creek.UI.EFML.Base.EFML.Processors
{
    using System.Xml;

    using Creek.UI.EFML.UI_Elements;

    public class LinkProcessor : ElementProcessor
    {
        #region Constructors and Destructors

        public LinkProcessor()
        {
            this.EventProvider = new LinkEventProvider();
        }

        #endregion

        #region Public Properties

        public override string Tagname
        {
            get
            {
                return "link";
            }
        }

        #endregion

        #region Public Methods and Operators

        public override void Process(out UiElement ui, XmlNode t, Builder b)
        {
            var eui = new Link { Href = t.GetAttributeByName("href") };

            this.EventProvider.Resolve(eui, t);
            ui = eui;
        }

        #endregion
    }
}